package com.voicechat.firstmet.net.service;

import android.text.TextUtils;
import android.util.Log;

import com.voicechat.firstmet.bean.AlipayBean;
import com.voicechat.firstmet.bean.Result;
import com.voicechat.firstmet.net.Params;

import rx.Observable;

/**
 * @ProjectName: FirstMet
 * @Package: com.voicechat.firstmet.net.service
 * @ClassName: AlipaySerivice
 * @Description: java类作用描述
 * @Author: ljp
 * @CreateDate: 2019/1/8 14:01
 * @Version: 1.0
 */
public class AlipaySerivice extends BasePayService {
    /**
     * @return
     * @method
     * @description 支付宝充值金币订单号请求
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<AlipayBean> alipayRecharge(String rechargeNumber, String rechargeId) {
        Params params = new Params();
      //  params.put("token", token);
       // params.put("equipmentId", equipmentId);
        params.put("rechargeNumber", rechargeNumber);
        params.put("rechargeId", rechargeId);//充值金额，（金额,金币）
        Log.i("LoginService",  params.toString());
        return sNetInterface.alipayRecharge(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 微信充值金币订单号请求
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<AlipayBean> weixinRecharge(String rechargeNumber, String rechargeId) {
        Params params = new Params();
        //  params.put("token", token);
        // params.put("equipmentId", equipmentId);
        params.put("rechargeNumber", rechargeNumber);
        params.put("rechargeId", rechargeId);//充值金额，（金额,金币）
        Log.i("LoginService",  params.toString());
        return sNetInterface.weixinRecharge(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 支付宝充值金币充值结果判断
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> judeAlipayRecharge(String orderString) {
        Params params = new Params();
        //  params.put("token", token);
        // params.put("equipmentId", equipmentId);
        params.put("orderString", orderString);
        Log.i("LoginService",  params.toString());
        return sNetInterface.judeAlipayRecharge(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 支付宝充值会员订单号请求
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<AlipayBean> alipayRechargeVIP(String rechargeNumber, String rechargeId) {
        Params params = new Params();
        //  params.put("token", token);
        // params.put("equipmentId", equipmentId);
        params.put("rechargeNumber", rechargeNumber);
        params.put("rechargeId", rechargeId);//充值金额，（金额,金币）
        Log.i("LoginService",  params.toString());
        return sNetInterface.alipayVip(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 支付宝充值会员充值结果判断
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> judeAlipayRechargeVIP(String orderString) {
        Params params = new Params();
        //  params.put("token", token);
        // params.put("equipmentId", equipmentId);
        params.put("orderString", orderString);
        Log.i("LoginService",  params.toString());
        return sNetInterface.judeAlipayRechargeVIP(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description  共享闺蜜预订单
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<AlipayBean>  getShareGirlsOrder(String friendReleaseId, String id,String userId,
                                                             String address, int time,int accompany,String remarks
            , int receiptStatus,int complete,int cancelSign,int money
    ) {
        Params params = new Params();
        params.put("friendReleaseId", friendReleaseId);//闺蜜信息id
        params.put("id", id);//闺蜜订单id
        params.put("userId", userId);//自己的id
        params.put("address", address);//约会地点
        params.put("time",time);//约会时间
        params.put("accompany", accompany);//陪同标记
        if(!TextUtils.isEmpty(remarks)) {
            params.put("remarks", remarks);//备注
        }
        params.put("receiptStatus",receiptStatus);//接单状态 初始值0 1拒绝 2同意
        params.put("complete",complete);//完成状态 1完成 2未完成 3取消 4已退款 5拒绝退款  初始值2
        params.put("cancelSign", cancelSign);//取消约会标记 初始值2 1可取消 2不可取消
        params.put("money", money);
        Log.i("getShareGirlsOrder", "getShareGirlsOrder: ---params---"+params);
        return sNetInterface.getShareGirlsOrder(params).compose(applySchedulers());
    }

    /**
     * @return
     * @method
     * @description 验证闺蜜支付成功发送自定义消息
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<Result> judeAlipay(String orderString) {
        Params params = new Params();
        //  params.put("token", token);
        // params.put("equipmentId", equipmentId);
        params.put("orderNumber", orderString);
        Log.i("LoginService",  params.toString());
        return sNetInterface.judeAlipay(params).compose(applySchedulers());
    }
    /**
     * @return
     * @method
     * @description 验证闺蜜支付成功发送自定义消息
     * @date: 2018/9/17 19:24
     * @author: ljp
     */
    public static Observable<AlipayBean> againPayOrder(String id,int money) {
        Params params = new Params();
        //  params.put("token", token);
         params.put("id", id);
        params.put("money", money);
        Log.i("LoginService",  params.toString());
        return sNetInterface.againPayOrder(params).compose(applySchedulers());
    }
}
